/*
 * @Description:
 * @Autor: zhangbing
 * @Date: 2021-07-27 21:44:46
 * @LastEditors: zhangbing
 * @LastEditTime: 2021-07-27 22:06:03
 */

export default {
  mounted(el, binding) {
      const {
          className,
          activeClass,
          curIdx
      } = binding.value,
          oNavItems = el.getElementsByClassName(className)
      oNavItems[curIdx].className += ` ${activeClass}`;
  },
  updated(el, binding) {
      const {
          className,
          activeClass,
          curIdx
      } = binding.value,
          oOptions = binding.oldValue,
          oNavItems = el.getElementsByClassName(className)
      oNavItems[curIdx].className += ` ${activeClass}`;
      oNavItems[oOptions.curIdx].className = className;
  },
}
